import {defineStore} from 'pinia';
import {ref,computed,watch} from 'vue';
export const useUserStore = defineStore('user',()=>{
    let firstName = ref('zhang');
    let lastName = ref('san');
    const changeFirstName=()=>{
        firstName.value = 'li';
    }
    const changeLastName=()=>{
        lastName.value = 'si';
    }
    const fullName = computed(()=>{
        return firstName.value+lastName.value;
    });
    console.log(fullName.value)
    watch(fullName,()=>{
        console.log('fullName',fullName)
    });
    return {
        firstName,
        lastName,
        fullName,
        changeFirstName,
        changeLastName
    }
});